import Vue from 'vue'
import Vuex from 'vuex'
import axios from "axios"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
   
     //资讯渲染
     nav:[],
     
  },
  mutations: {
  
    navdata(state, payload) {
      state[payload.key] = payload.value
    },
     
  },
  actions: {

     //房源管理渲染
     async requestData({ commit }) {
      let res = await axios.post("/api/zixun")
      commit("navdata", { key: 'nav', value: res.data.data })
    },
  },
  modules: {
  }
})
